package com.superbytecode.cloud.common.entities.diff;

import lombok.Data;

/**
 * All rights Reserved, Designed By www.super-master.com
 *
 * @ProjectName: sanskrit
 * @Package: com.superbytecode.cloud.core.entities.diff
 * @ClassName: FieldDifference
 * @Description: [字段值差异]
 * <p> </p>
 * @Author: [Lance Ting]
 * @Date: 2024/8/16 16:43
 * @Version: V1.0
 * @Copyright: 2024 www.super-master.cn Inc. All rights reserved.
 * TODO: 注意,本文件Lance Ting所作,如果转载或使用请标明具体出处!
 **/
@Data
public class Difference {
    /**
     * obj字段
     */
    private String column;
    /**
     * obj字段类型
     */
    private String type;
    /**
     * obj字段注解
     */
    private String explain;
    /**
     * 字段原始值和目标值
     */
    private FieldProperty property;

    // -----------------------------------------------------------------------------------------------------------------
    public static Difference newInstance(String column, String type, String explain, FieldProperty property) {
        Difference difference = new Difference();
        difference.setColumn(column);
        difference.setType(type);
        difference.setExplain(explain);
        difference.setProperty(property);
        return difference;
    }
    public static Difference newInstance(String column, FieldProperty property) {
        Difference difference = new Difference();
        difference.setColumn(column);
        difference.setProperty(property);
        return difference;
    }
}